package com.dongdongshop.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdongshop.mapper.TbContentCategoryMapper;
import com.dongdongshop.pojo.TbContentCategory;
import com.dongdongshop.service.TbContentCategoryService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
@org.springframework.stereotype.Service
public class TbContentCategoryServiceImpl implements TbContentCategoryService {

    @Autowired
    private TbContentCategoryMapper tbContentCategoryMapper;

    @Override
    public List<TbContentCategory> getCategoryList() {
        List<TbContentCategory> list = tbContentCategoryMapper.selectByExample(null);
        return list;
    }

    @Override
    public void insertCategory(TbContentCategory tbContentCategory) {
        tbContentCategoryMapper.insertSelective(tbContentCategory);
    }

    @Override
    public TbContentCategory updateCategory(Long id) {
        return tbContentCategoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public void updateCategoryInfo(TbContentCategory tbContentCategory) {
        tbContentCategoryMapper.updateByPrimaryKeySelective(tbContentCategory);
    }

    @Override
    public void deleteCatInfo(Long[] ids) {
        tbContentCategoryMapper.deleteCatInfo(ids);
    }
}
